package mainPack;

public class UsedBattery extends Battery {

	private String usedBy;
	private int quantity;

	public UsedBattery(String M, String P, int T, int PR, int W, double AH,
			double WH, double DP, int V, int C) {
		super(M, P, T, PR, W, AH, WH, DP, V, C);
	}

	public UsedBattery(Battery B, String A, int Q){
		Model=B.getModel();
		Producer=B.getProducer();
		Type=B.getType();
		Price=B.getPrice();
		Weight=B.getWeight();
		Ah=B.getAh();
		Wh=B.getWh();
		DischargePower=B.getDischargePower();
		Voltage=B.getVoltage();
		Cycles=B.getCycles();
		usedBy=A;
		quantity=Q;
	}

	@Override
	public String toString() {
		//		return "UsedBattery [usedBy=" + usedBy + ", quantity=" + quantity
		//				+ ", Model=" + Model + ", Producer=" + Producer + ", Type="
		//				+ Type + ", Price=" + Price + ", Weight=" + Weight + ", Ah="
		//				+ Ah + ", Wh=" + Wh + ", DischargePower=" + DischargePower
		//				+ ", Voltage=" + Voltage + ", Cycles=" + Cycles + "]";
		String TypeText;
		if(Type==1) TypeText="Li-ion battery";
		else TypeText="lead-acid battery";
		return quantity+"x "+TypeText+" \""+Model+"\" produced by \""+Producer+"\"";
	}

	@Override
	public String toCSV(){
		return usedBy+";"+quantity+";"+Model+";"+Producer+";"+Type+";"+Price+";"+Weight+";"+Ah+";"+Wh+";"+DischargePower+";"+Voltage+";"+Cycles+";";
	}

	public String getUsedBy() {
		return usedBy;
	}

	public void setUsedBy(String usedBy) {
		this.usedBy = usedBy;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}


}
